package com.acme.bankapp.domain.bank;

/**
 * Abstract class for account classes
 * @author alex
 */
public abstract class AbstractAccount implements Account {
	protected double balance;
	
	/**
	 * @param balance the balance
	 */
	public AbstractAccount(double balance) {
		if (balance >= 0) {
			this.balance = balance;
		} else {
			throw new IllegalArgumentException();
		}
	}
	
	/**
	 * @return the balance
	 */
	public double getBalance() {
		return this.balance;
	}
	
	/**
	 * @param x the money
	 */
	public void deposit(double x) {
		this.balance += x;
	}
}
